<?php

/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Blog
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: AdminSettingsController.php 7244 2010-09-01 01:49:53Z john $
 * @author     Jung
 */

/**
 * @category   Application_Extensions
 * @package    Blog
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Minify_AdminSettingsController extends Core_Controller_Action_Admin {
 
    public function indexAction() {

        // Make form
        $this->view->form = $form = new Minify_Form_Admin_Global();

        $settings = Engine_Api::_()->getApi('settings', 'core');
        $values = $settings->minify;
        $form->mincss->setValue($values['mincss']['enable']);       
        $form->minjs->setValue($values['minjs']['enable']);
        
        if (!$this->getRequest()->isPost()) {
            return;
        }
        if (!$form->isValid($this->getRequest()->getPost())) {
            return;
        }
        $req = $this->getRequest();
        $values['mincss']['enable'] = $req->getParam('mincss');
        $values['minjs']['enable'] = $req->getParam('minjs');//      
        $settings->minify = $values;
        $form->addNotice('Your changes have been saved');
        
    }

}